[PATCH] rts: Fix invocation of __ieee_set_fp_control() on alpha-linux
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 3 Oct 2024 12:30:23 +0000 (14:30 +0200)
committerIlias Tsitsimpis <iliastsi@debian.org>
Sat, 24 Jan 2026 12:41:42 +0000 (14:41 +0200)
Fixes the following error when building GHC on alpha-linux:

rts/posix/Signals.c: In function ‘initDefaultHandlers’:

rts/posix/Signals.c:709:5: error:
     error: implicit declaration of function ‘ieee_set_fp_control’ [-Wimplicit-function-declaration]
      709 |     ieee_set_fp_control(0);
          |     ^~~~~~~~~~~~~~~~~~~
    |
709 |     ieee_set_fp_control(0);
    |

Gbp-Pq: Name alpha-fix-ieee_set_fp_control-invocation.patch

rts/posix/Signals.c

index c21a5c07e599fa3533b500be56e517f8437cc717..ea2845d46163cf5febbd2bf5168064e061e52391 100644 (file)
@@ -21,7 +21,7 @@
 
 #if defined(alpha_HOST_ARCH)
 # if defined(linux_HOST_OS)
-#  include <asm/fpu.h>
+#  include <fenv.h>
 # else
 #  include <machine/fpu.h>
 # endif
@@ -715,7 +715,11 @@ initDefaultHandlers(void)
 #endif
 
 #if defined(alpha_HOST_ARCH)
+# if defined(linux_HOST_OS)
+    __ieee_set_fp_control(0);
+# else
     ieee_set_fp_control(0);
+# endif
 #endif
 
     // ignore SIGPIPE; see #1619